import Vue from "vue";
import VueRouter from "vue-router";

import Home from "../views/Home.vue";
import Test from "../views/Test.vue";
import PostDetails from "@/views/PostDetails"
import MoreComment from "@/views/MoreComment"

import Login from "../views/Login.vue";
import Register from "../views/Register.vue";

import PersonalIndex from "@/views/Personal/Index.vue";
import PersonalBackgroundImg from "@/views/Personal/BackgroundImg.vue";
import PersonalEdit from "@/views/Personal/Edit.vue";
import PersonnalFollows from "@/views/Personal/Follows.vue";
import PersonnalTheme from "@/views/Personal/Theme.vue";

Vue.use(VueRouter);

const routes = [
  {
    path: "/",
    name: "Home",
    component: Home,
  },
  {
    path: "/test",
    name: "Test",
    component: Test,
  },
  {
    path: "/details/:id",
    name: "Details",
    component: PostDetails,
  },
  {
    path: "/morecomment/:id",
    name: "MoreComment",
    component: MoreComment,
  },

  {
    path: "/login",
    name: "Login",
    component: Login,
  },
  {
    path: "/register",
    name: "Register",
    component: Register,
  },

  {
    path: "/personal",
    name: "Personal",
    component: PersonalIndex,
    meta: {
      auth: true,
    },
  },
  {
    path: "/background",
    name: "BackgroundImg",
    component: PersonalBackgroundImg,
    meta: {
      auth: true,
    },
  },
  {
    path: "/edit",
    name: "Edit",
    component: PersonalEdit,
    meta: {
      auth: true,
    },
  },
  {
    path: "/follows",
    name: "Follow",
    component: PersonnalFollows,
    meta: {
      auth: true,
    },
  },
  {
    path: "/theme",
    name: "Theme",
    component: PersonnalTheme,
    meta: {
      auth: true,
    },
  },
];

const router = new VueRouter({
  routes,
});

export default router;
